import socket
import hmac
sk=socket.socket()
sk.connect(('127.0.0.1',8080))
password_key=b'sxj'
msg_key = sk.recv(1024)
h=hmac.new(password_key,msg_key)
key2=h.digest()
sk.send(key2)
while True:
    c_msg=input('client>>>').encode('utf-8')
    sk.send(c_msg)
    msg=sk.recv(1024).decode('utf-8')
    print(msg)
    if msg=='bye':
        sk.send(b'bye')
        break
sk.close()